//
//  JMInstructionController.m
//  OpenSesame
//
//  Created by zhangjiaming on 16/1/12.
//  Copyright © 2016年 OpenSesame. All rights reserved.
//

#import "JMInstructionController.h"

@interface JMInstructionController ()

@end

@implementation JMInstructionController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // 设置最底部的打开蓝牙
    UIButton *openBtn = [[UIButton alloc] init];
    [self.view addSubview:openBtn];
    openBtn.frame = CGRectMake(10, JMPhoneHeight - 60, JMPhoneWidth - 20, 50);
    [openBtn setImage:[UIImage imageNamed:@"openBlueTooth"] forState:UIControlStateNormal];
    [openBtn setImage:[UIImage imageNamed:@"openBlueToothH"] forState:UIControlStateHighlighted];
    [openBtn addTarget:self action:@selector(openBluetooth) forControlEvents:UIControlEventTouchUpInside];
}

/** 打开蓝牙 */
- (void)openBluetooth {
    NSURL *url = [NSURL URLWithString:@"prefs:root=Bluetooth"];
    if ([[UIApplication sharedApplication] canOpenURL:url]) {
        [[UIApplication sharedApplication] openURL:url];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
